# Write CORO build configuration

if(CONFIG_CORO)
  add_library(coro.lib INTERFACE)
  target_include_directories(coro.lib INTERFACE include/public)
  target_link_libraries(
    coro.lib
    INTERFACE pw_async2_basic.dispatcher_backend
              pw_allocator
              pw_async2.pend_func_task
              pw_allocator.block.detailed_block
              pw_allocator.bucket.sequenced
              pw_allocator.best_fit
              pw_async2.coro
              pw_async2.time_provider
              pw_preprocessor)
  if(CONFIG_CORO_USE_TEST_TIMER)
    target_link_libraries(coro.lib INTERFACE pw_async2.simulated_time_provider)
  endif()
  target_compile_options(coro.lib INTERFACE -Wno-psabi)
  zephyr_link_libraries(coro.lib)
endif()
